Stored Procedures [dbo].[asi_RosterManagementCreateCompanyAdministrators]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)
@MEMBER_TYPEvarchar(50)50
SQL Script
CREATE PROCEDURE asi_RosterManagementCreateCompanyAdministrators
@MEMBER_TYPE varchar(50)
AS
/*
This Stored Procedure will add all members that have the specified member type
and are a member of a company to the Company Administrator Role, allowing
them to edit other members of thier company
*/

INSERT INTO UserRole([UserKey],[RoleKey])
SELECT [UserKey],'4f0f93a9-00ee-40ba-bcbc-99a5beb21179' FROM UserMain
INNER JOIN [Name] ON [Name].[ID] = [UserMain].[ContactMaster]
WHERE [Name].[MEMBER_TYPE] = @MEMBER_TYPE AND [Name].[CO_ID] <> ''
AND [UserKey] NOT IN (Select [UserKey] FROM [UserRole] WHERE [RoleKey] = '4f0f93a9-00ee-40ba-bcbc-99a5beb21179')

GO
Uses